package cn.tedu.file;

import java.io.File;
import java.util.Scanner;
public class Test2_DiGuiShanChu {
    public static void main(String[] args) {
        String dirpath = new Scanner(System.in).nextLine();
        File dir = new File(dirpath);
          totalDelete(dir);
        System.out.println("文件夹已删除");

    }
    public static void totalDelete(File dir){
        File []fs =dir.listFiles();
        for (int i = 0; i <fs.length; i++) {
            if(fs[i].isFile()){
                fs[i].delete();
            }else if(fs[i].isDirectory() ){
                totalDelete(fs[i]);
            }
        }
        dir.delete();
    }
}
